package br.com.werp.suporte.Hardware;
import java.util.*;
import org.apache.struts.action.*;
import javax.servlet.http.*;

/**
 * Creation Date 03/09/2004 10:26:46
 * Last Modify Date 21/12/2005 13:29:44
 */

public class PlacaMaeDetalheActionForm extends org.apache.struts.action.ActionForm {
  public String plac_id;
  public String plac_marca;
  public String plac_modelo;
  private boolean valida = false;
  public PlacaMaeDetalheActionForm() {
  }
  /**
    * PLAC_ID: Gets the value of this field.
    */
  public String getPlac_id() {
    return plac_id;
  }
  /**
     * PLAC_ID: Sets thhe value for this field.
     */
  public void setPlac_id(String PLAC_ID) {
    plac_id = PLAC_ID;
  }
  /**
    * PLAC_MARCA: Gets the value of this field.
    */
  public String getPlac_marca() {
    return plac_marca;
  }
  /**
     * PLAC_MARCA: Sets thhe value for this field.
     */
  public void setPlac_marca(String PLAC_MARCA) {
    plac_marca = PLAC_MARCA;
  }
  /**
    * PLAC_MODELO: Gets the value of this field.
    */
  public String getPlac_modelo() {
    return plac_modelo;
  }
  /**
     * PLAC_MODELO: Sets thhe value for this field.
     */
  public void setPlac_modelo(String PLAC_MODELO) {
    plac_modelo = PLAC_MODELO;
  }
  /**
    * Reset all fields.
    */
  public void reset(org.apache.struts.action.ActionMapping mapping,
      javax.servlet.http.HttpServletRequest request) {
    plac_id = null;
    plac_marca = null;
    plac_modelo = null;
  }
  /**
    * Validate fields and return ActionErrors.
    */

  public ActionErrors validate(org.apache.struts.action.ActionMapping mapping,
      javax.servlet.http.HttpServletRequest request) {
    ActionErrors errors = new ActionErrors();
    valida = false;
    if (!com.egen.util.struts.Token.isTokenValid(mapping, request)) {
      errors.add("Warning", new ActionError("token.error","<br>","","",""));
    }
    com.egen.util.struts.Token.saveToken(mapping, request);
    if (com.egen.util.text.Validate.isValidate("update_action,delete_action,",
        request)) {
      if (com.egen.util.text.Validate.isNull(plac_id)) {
        errors.add("ActionErrors.GLOBAL_ERROR",
            new ActionError("error.validate.notnull","plac_id","plac_id",
                "0"));
      }
      if (com.egen.util.text.Validate.isNull(plac_marca)) {
        errors.add("ActionErrors.GLOBAL_ERROR",
            new ActionError("error.validate.notnull","Marca","plac_marca",
                "0"));
      }

    }
    if (errors != null && errors.size() > 0) {
      javax.servlet.http.HttpSession session = request.getSession(true);
      ActionForward actionForward = null;
      session.setAttribute(mapping.getName(), this);
    }
    return errors;
  }
}
